﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Cotrobaie
{
    public partial class ExploreProducts : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            ImageButton1.Attributes.Add("onMouseOut", "this.src='/images/popular.png'");
            ImageButton1.Attributes.Add("onMouseOver", "this.src='/images/opopular.png'");
            ImageButton2.Attributes.Add("onMouseOut", "this.src='/images/recomm.png'");
            ImageButton2.Attributes.Add("onMouseOver", "this.src='/images/orecomm.png'");
            ImageButton3.Attributes.Add("onMouseOut", "this.src='/images/visited.png'");
            ImageButton3.Attributes.Add("onMouseOver", "this.src='/images/ovisited.png'");
           


            if (Session["vis"] == null)
                Session["vis"] = 1;
            CssStyleCollection cs;
            if (Session["UserID"] != null)
            {
                HyperLinkLogin.Text = "See more!";
                HyperLinkLogin.NavigateUrl = "Recommendations.aspx";
            }
            else
            {
                cs = Iframe1.Attributes.CssStyle;
                cs.Add("height", "50px");
                HyperLinkLogin.Style.Add("position", "relative");
                HyperLinkLogin.Style.Add("left", "200px");
            }

            if (Session["vis"] == "1")
            {
                popular.Visible = true;
                recomm.Visible = false;
                visited.Visible = false;
            }
            else
                if (Session["vis"] == "2")
                {
                    popular.Visible = false;
                    visited.Visible = false;
                    recomm.Visible = true;
                }
                else
                {
                    popular.Visible = false;
                    recomm.Visible = false;
                    visited.Visible = true;
                }
        }


        protected void goHome(object sender, EventArgs e)
        {
            Response.Redirect("~/Home.aspx");
        }

        protected void showStuff(object sender, EventArgs e)
        {
            ImageButton but = (ImageButton)sender;
            if (but.ID == "ImageButton1")
            {
                
                Session["vis"] = "1";
                Response.Redirect("~/ExploreProducts.aspx");
            }
            else if (but.ID == "ImageButton2")
            {
                Session["vis"] = "2";
                Response.Redirect("~/ExploreProducts.aspx");
            }
            else
            {
               
                Session["vis"] = "3";
                Response.Redirect("~/ExploreProducts.aspx");
            }
        }
    }
}